
<php> D('Home/Member')->need_login();</php>
<!--[if lt IE 8]>
<div class="alert alert-danger" style="margin-bottom: 0">您正在使用 <strong>过时的</strong> 浏览器. 是时候 <a target="_blank" href="http://browsehappy.com/">更换一个更好的浏览器</a> 来提升用户体验.</div>
<![endif]-->
<div id="top_bar" class="top_bar">
    <div class="container">
        <div class="row  ">
            <if condition="is_login()">
                <else/>
                <div class="col-xs-6 text-center visible-xs">
                    <a href="{:U('Home/User/login')}" style="padding-top: 10px;display: block;font-size: 16px;color: #ccc !important;">登录</a>
                </div>
                <div class="col-xs-6 text-center visible-xs">
                    <a href="{:U('Home/User/register')}" style="padding-top: 10px;display: block;font-size: 16px;color: #ccc!important;">注册</a>
                </div>
            </if>
            <div class="col-md-6 col-sm-6 hidden-xs">
               <if condition="C('SHARE_WEIBO_ID') neq ''"> 分享<a class="share_weibo" id="weibo_shareBtn" target="_blank"></a>
                   <script>
                       $(function () {
                           weiboShare();//处理微博分享
                       })
                   </script>
               </if>
            </div>
            <div class="col-md-6 col-xs-12  text-right top_right">
                <php>
                    $unreadMessage=D('Common/Message')->getHaventReadMeassageAndToasted(is_login());
                </php>

                <ul class="nav navbar-nav navbar-right">
                    <!-- <li>
                         &lt;!&ndash;换肤功能预留&ndash;&gt;
                        <a>换肤</a>
                        &lt;!&ndash;换肤功能预留end&ndash;&gt;
                    </li>-->
                    <!--登陆面板-->
                    <if condition="is_login()">
                        <li class="dropdown op_nav_ico hidden-xs hidden-sm">
                            <div></div>
                            <a id="nav_info" class="dropdown-toggle text-left" data-toggle="dropdown">
                                <span class="glyphicon glyphicon-bell"></span>
                                <span id="nav_bandage_count"
                                <if condition="count($unreadMessage) eq 0"> style="display: none"</if>
                                class="badge pull-right">{:count($unreadMessage)}</span>
                                &nbsp;
                            </a>
                            <ul class="dropdown-menu extended notification">
                                <li style="padding-left: 15px;padding-right: 15px;">
                                    <div class="row nav_info_center">
                                        <div class="col-xs-9 nav_align_left"><span
                                                id="nav_hint_count">{:count($unreadMessage)}</span> 条未读
                                        </div>
                                        <div class="col-xs-3"><i onclick="setAllReaded()"
                                                                 class="set_read glyphicon glyphicon-ok"
                                                                 title="全部标为已读"></i></div>
                                    </div>
                                </li>
                                <li>
                                    <div style="position: relative;width: auto;overflow: hidden;max-height: 250px ">
                                        <ul id="nav_message" class="dropdown-menu-list scroller "
                                            style=" width: auto;">
                                            <if condition="count($unreadMessage) eq 0">
                                                <div style="font-size: 18px;color: #ccc;font-weight: normal;text-align: center;line-height: 150px">
                                                    暂无任何消息!
                                                </div>
                                                <else/>
                                                <volist name="unreadMessage" id="message">
                                                    <li>
                                                        <a data-url="{$message.url}"
                                                           onclick="readMessage(this,{$message.id})">
                                                            <i class="glyphicon glyphicon-bell"></i>
                                                            {$message.title}
                                            <span class="time">
                                            {$message.ctime}
                                            </span>
                                                        </a>
                                                    </li>
                                                </volist>
                                            </if>

                                        </ul>
                                    </div>
                                </li>
                                <li class="external">
                                    <a href="{:U('Usercenter/Message/message')}">
                                        消息中心 <i class="glyphicon glyphicon-circle-arrow-right"></i>
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <a style="margin-right: 15px;" title="修改资料" href="{:U('Usercenter/Config/index')}"><i
                                    class="glyphicon glyphicon-cog"></i></a>
                        </li>
                        <li class="dropdown">
                            <php>
                                $common_header_user = query_user(array('nickname'));
                            </php>
                            <a role="button" class="dropdown-toggle dropdown-toggle-avatar" data-toggle="dropdown">
                                {$common_header_user.nickname}&nbsp;<i style="font-size: 12px"
                                                                       class="glyphicon glyphicon-chevron-down"></i>
                            </a>
                            <ul class="dropdown-menu text-left" role="menu">
                                <li><a href="{:U('UserCenter/Index/index')}"><span
                                        class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;个人主页</a>
                                </li>
                                <li><a href="{:U('Usercenter/message/message')}"><span
                                        class="glyphicon glyphicon-star"></span>&nbsp;&nbsp;消息中心</a>
                                </li>
                                <li><a href="{:U('Usercenter/Collection/index')}"><span
                                        class="glyphicon glyphicon-star"></span>&nbsp;&nbsp;我的收藏</a>
                                </li>
                                <li><a href="{:U('People/Index/ranking')}"><span
                                        class="glyphicon glyphicon-list"></span>&nbsp;&nbsp;签到排行</a>
                                </li>
                                <li><a href="{:U('Usercenter/Index/rank')}"><span
                                        class="glyphicon glyphicon-star"></span>&nbsp;&nbsp;我的头衔</a>
                                </li>
                                {:hook('personalMenus')}
                                <if condition="is_administrator()">
                                    <li><a href="{:U('Admin/Index/index')}" target="_blank"><span
                                            class="glyphicon glyphicon-dashboard"></span>&nbsp;&nbsp;管理后台</a></li>
                                </if>
                                <li><a event-node="logout"><span
                                        class="glyphicon glyphicon-off"></span>&nbsp;&nbsp;注销</a>
                                </li>
                            </ul>
                        </li>
                        <else/>
                        <li class="hidden-xs">
                            <a href="{:U('Home/User/login')}">登录</a>
                        </li>
                        <li class="hidden-xs">
                            <a href="{:U('Home/User/register')}">注册</a>
                        </li>
                    </if>
                </ul>
            </div>
        </div>
    </div> 
    <!--换肤插件钩子start-->
    {:hook('setSkin')}
    <!--换肤插件钩子 end-->
</div>
<div id="logo_bar" class="logo_bar">
    <div class="row">
        <div class="logo">
            <div class="col-md-7">
                <a href="{:U('Home/Index/index')}"><img src="__PUBLIC__/Core/images/logo.png" style="max-width: 100%"/></a>
            </div>
            <div class="col-md-4 hidden-xs">
                    <div class="pull-right text-right" style="padding-top:4px;">
                        <form class="navbar-form navbar-right search_bar" role="search" id="forum_search" method="post">
                            <div class="form-group">
                                <div class="input-group">
                                    <input type="text" class="form-control" name="keywords" placeholder="查找">

                                    <div class="input-group-btn text-left">
                                        <button type="button" class="btn btn-default dropdown-toggle"
                                                style="border-left: none;border-top-left-radius: 0;border-bottom-left-radius: 0"
                                                data-toggle="dropdown"><span class="glyphicon glyphicon-search"></span>
                                        </button>
                                        <ul class="dropdown-menu pull-right" role="menu">
                                            <li><a class="submit_search weibo_search" url="{:U('Weibo/Index/search')}">微博</a></li>
                                            <li><a class="submit_search" url="{:U('Forum/Index/search')}">论坛</a></li>
                                            <li><a class="submit_search" url="{:U('Jtbk/Index/search')}">集体备课</a></li>
                                            <li><a class="submit_search" url="{:U('People/Index/find')}">会员</a></li>
                                        </ul>
                                    </div>
                                    <script>
                                        $(function () {
                                            $('#forum_search').attr('action', $('.weibo_search').attr('url'));
                                            $('.submit_search').click(function () {
                                                $('#forum_search').attr('action', $(this).attr('url'));
                                                $('#forum_search').submit();
                                            });
                                        })
                                    </script>
                                </div>
                            </div>
                        </form>
                    </div>
            </div>

        </div>
    </div>
</div>
<!--导航菜单start-->
<div id="nav_bar_wrapper">
<div id="nav_bar" class="nav_bar " style="margin-bottom: 25px;">
    <nav id="nav_bar_container" class="nav" role="navigation">
        <div class="collapse navbar-collapse " id="nav_bar_main">

            <ul class="nav navbar-nav  " style="font-size: 16px">
                <think:nav name="nav">
                    <eq name="nav.pid" value="0">
                        <php>
                            $children=D('Channel')->where(array('pid'=>$nav['id']))->order('sort asc')->select();
                            if($children){
                        </php>
                        <li class="dropdown">
                            <a class="dropdown-toggle nav_item" data-toggle="dropdown" href="#" style="color:{$nav.color}">

                                {$nav.title} <span class="caret"></span><neq name="nav.band_text" value="" > <span class="badge" style="background: {$nav.band_color}">{$nav.band_text}</span></neq>
                            </a>
                            <ul class="dropdown-menu">
                                <volist name="children" id="subnav">
                                    <li role="presentation"><a role="menuitem" tabindex="-1" style="color:{$subnav.color}"
                                                               href="{$subnav.url|get_nav_url}"
                                                               target="<eq name='subnav.target' value='1'>_blank<else/>_self</eq>">
                                                               {$subnav.title}<neq name="subnav.band_text" value="" >  <span class="badge" style="background: {$subnav.band_color}">{$subnav.band_text}</span></neq></a>
                                    </li>
                                </volist>
                            </ul>
                        </li>
                        <php>}else{</php>
                        <li class="<eq name='nav.url|get_nav_active' value='1'>active<else/></eq>">
                            <a href="{$nav.url|get_nav_url}"
                               target="<eq name='nav.target' value='1'>_blank<else/>_self</eq>" style="color:{$nav.color}">
                               <neq name='nav.icon' value="">
                               <i class="glyphicon glyphicon-{$nav.icon}"></i></neq>
                               {$nav.title}

                               <neq name="nav.band_text" value="" >  <span class="badge" style="background: {$nav.band_color}">{$nav.band_text}</span></neq></a>
                        </li>
                        <php>}</php>
                    </eq>
                </think:nav>
            </ul>

        </div>

        <!--导航栏菜单项-->

        <div class="row visible-xs">
            <div class="navbar-header col-xs-3 pull-right text-left">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#nav_bar_main">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
        </div>


    </nav>
</div>
</div>
<a id="goTopBtn"></a>